//
//  StrategyHeaderView.m
//  FreeTrip
//
//  Created by 邓芮 on 15/11/25.
//  Copyright © 2015年 邓芮. All rights reserved.
//

#import "StrategyHeaderView.h"

@interface StrategyHeaderView ()
@property (nonatomic, strong) UIImageView *icon;

@property (nonatomic, strong) UILabel *label;
@end

@implementation StrategyHeaderView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        CGFloat x = 10 * KScreenWidth/414;
        CGFloat y = 5 * KScreenWidth / 414;
        CGFloat width = 30 * KScreenWidth / 414;
        CGFloat height = 40 * KScreenWidth / 414;
        self.icon = [[UIImageView alloc]initWithFrame:CGRectMake(x, y, width, width)];
        [self addSubview:self.icon];
        
        self.label = [[UILabel alloc]initWithFrame:CGRectMake(x+width + y, 0, frame.size.width - (x + width + y), height)];
        self.label.textAlignment = NSTextAlignmentLeft;
        self.label.textColor = [UIColor blackColor];
        self.label.font = [UIFont systemFontOfSize:21 * KScreenWidth / 414];
        [self addSubview:self.label];
    }
    return self;
}

- (void)setModel:(StrategyModel *)model
{
    _model = model;
    switch (model.category_type)
    {
        case 0:
        {
            self.label.text = @"概览";
            self.icon.image = [UIImage imageNamed:@"overView"];
            break;
        }
        case 1:
        {
            self.label.text = @"出行须知";
            self.icon.image = [UIImage imageNamed:@"Notes"];
            break;
        }
        case 2:
        {
            self.label.text = @"如何到达";
            self.icon.image = [UIImage imageNamed:@"feiji"];
            break;
        }
        case 3:
        {
            self.label.text = @"当地交通";
            self.icon.image = [UIImage imageNamed:@"bus"];
            break;
        }
        case 4:
        {
            self.label.text = @"景点";
            self.icon.image = [UIImage imageNamed:@"view"];
            break;
        }
        case 5:
        {
            self.label.text = @"娱乐";
            self.icon.image = [UIImage imageNamed:@"yule"];
            break;
        }
        case 6:
        {
            self.label.text = @"住宿";
            self.icon.image = [UIImage imageNamed:@"zhusu"];
            break;
        }
        case 7:
        {
            self.label.text = @"美食";
            self.icon.image = [UIImage imageNamed:@"meishi"];
            break;
        }
        case 8:
        {
            self.label.text = @"购物";
            self.icon.image = [UIImage imageNamed:@"gouwu"];
            break;
        }
        case 9:
        {
            self.label.text = @"离境需知";
            self.icon.image = [UIImage imageNamed:@"departure"];
            break;
        }
        case 10:
        {
            self.label.text = @"";
            break;
        }
        case 11:
        {
            self.label.text = @"其他";
            self.icon.image = [UIImage imageNamed:@"qita"];
            break;
        }
        default:
            break;
    }
}

@end
